From 78e64de9c7335ff83cedf00467fbb14dac300400 Mon Sep 17 00:00:00 2001 From: Natalie Boehm Date: Thu, 22 Jun 2017 16:34:57 -0400 Subject: [PATCH] Added comments indicating which parts should be removed at appropriate time --- src/bin/publish.rs | 15 ++++++++++----- tests/publish.rs | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/bin/publish.rs b/src/bin/publish.rs index 36b7806d9..507496b46 100644 --- a/src/bin/publish.rs +++ b/src/bin/publish.rs @@ -6,7 +6,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(Deserialize)] pub struct Options { flag_index: Option, - flag_host: Option, + flag_host: Option, // TODO: Deprecated, remove flag_token: Option, flag_manifest_path: Option, flag_verbose: u32, @@ -28,8 +28,8 @@ Usage: Options: -h, --help Print this message - --index INDEX Host to upload the package to - --host HOST DEPRECATED + --index INDEX Registry index to upload the package to + --host HOST DEPRECATED, renamed to '--index' --token TOKEN Token to use when uploading --no-verify Don't verify package tarball before publish --allow-dirty Allow publishing with a dirty source directory @@ -56,7 +56,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult { let Options { flag_token: token, flag_index: index, - flag_host: host, + flag_host: host, // TODO: Deprecated, remove flag_manifest_path, flag_no_verify: no_verify, flag_allow_dirty: allow_dirty, @@ -66,6 +66,11 @@ pub fn execute(options: Options, config: &Config) -> CliResult { } = options; + // TODO: Deprecated + // remove once it has been decided --host can be removed + // We may instead want to repurpose the host flag, as + // mentioned in this issue + // https://github.com/rust-lang/cargo/issues/4208 let msg = "The flag '--host' is no longer valid. Previous versions of Cargo accepted this flag, but it is being @@ -84,7 +89,7 @@ about this warning."; token: token, index: if host.clone().is_none() || host.clone().unwrap().is_empty() { index } - else { config.shell().warn(&msg)?; host }, + else { config.shell().warn(&msg)?; host }, // TODO: Deprecated, remove verify: !no_verify, allow_dirty: allow_dirty, jobs: jobs, diff --git a/tests/publish.rs b/tests/publish.rs index d2b3e748a..166b021c7 100644 --- a/tests/publish.rs +++ b/tests/publish.rs @@ -94,6 +94,8 @@ See [..] } } +// TODO: Deprecated +// remove once it has been decided --host can be removed #[test] fn simple_with_host() { setup(); @@ -158,6 +160,8 @@ See [..] } } +// TODO: Deprecated +// remove once it has been decided --host can be removed #[test] fn simple_with_index_and_host() { setup(); -- 2.30.2